import matplotlib.pyplot as plt
#支持中文
plt.rcParams['font.family'] = ['sans-serif']
plt.rcParams['font.sans-serif'] = ['SimHei']
# 数据准备
x = [1, 2, 3, 4, 5]
y = [2, 3, 5, 7, 11]
# 绘制图形
plt.figure(figsize=(8, 6))
# 自定义线型、颜色、标记等
plt.plot(x, y, 
         color='#FF5733',    # 十六进制颜色
         linestyle='-.',     # 点划线
         linewidth=2,
         marker='D',         # 菱形标记
         markersize=8,
         markerfacecolor='white',
         markeredgecolor='#FF5733',
         markeredgewidth=1.5)
plt.title("自定义样式的折线图")
plt.grid(True, linestyle=':', alpha=0.5)
plt.show()
